#pragma once

#include <QtGui>

class SkinBaseWidget : public QWidget
{
	Q_OBJECT

public:
	SkinBaseWidget(QWidget *parent = 0, bool isMainForm = true);

signals:
	void quit();

protected:
	virtual bool	winEvent(MSG *message, long *result);
	virtual void	paintEvent(QPaintEvent *event);
	virtual void	resizeEvent(QResizeEvent *e);
	virtual void	closeEvent(QCloseEvent *e);
	virtual void	mouseDoubleClickEvent(QMouseEvent *e);
	virtual void	mouseDoubleClickEvent();

	void setupUI();	
	void changeRegion();
	void centerForm();

protected:
	bool	m_isMainForm;
	QPixmap m_Bg_TitleLeft;
	QPixmap m_Bg_TitleRight;
	QPixmap m_Bg_TitleCenter;
	QPixmap m_Bg_Left;
	QPixmap m_Bg_Right;
	QPixmap m_Bg_BottomLeft;
	QPixmap m_Bg_BottomCenter;
	QPixmap m_Bg_BottomRight;
	QPixmap m_Reg_TitleLeft;
	QPixmap m_Reg_TitleRight;
	QPixmap m_Bg_Toolbar;
	bool	m_isMax;
	QRect	m_normalRc;	
	QMenu	*m_sysRightMenu;
	QPixmap m_titleIcon;
	QAbstractButton *m_closeButton;
	QAbstractButton *m_maxButton;
	QAbstractButton *m_minButton;

protected slots:
	void Quit();
	void ChangeMax();
	void ShowMin();
};